﻿using System.Globalization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

namespace Nxg.Blog.Web {
    public class Program {
        public static void Main (string[] args) {
            CultureInfo.DefaultThreadCurrentCulture = new CultureInfo ("zh-CN");
            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo ("zh-CN");
            CreateHostBuilder (args).ConfigureWebHostDefaults (builder => {
                builder.ConfigureKestrel (options => { options.AddServerHeader = false; })
                    .UseUrls ("http://*:5050");
            }).ConfigureAppConfiguration (builder => {
                builder.AddCommandLine (args);
            }).Build ().Run ();
        }

        public static IHostBuilder CreateHostBuilder (string[] args) =>
            Host.CreateDefaultBuilder (args)
            .ConfigureWebHostDefaults (webBuilder => {
                webBuilder.UseStartup<Startup> ();
            })
            .UseDefaultServiceProvider ((context, options) => {
                options.ValidateScopes = false;
                options.ValidateOnBuild = false;
            });
    }
}